package com.project.service.LogService.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.LogBean;
import com.project.mapper.ILogMapper.ILogMapper;
import com.project.service.LogService.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
@Service
@Transactional
public class LogServicelmpl implements ILogService {
    @Autowired
    private ILogMapper mapper;
    @Override
    public void add(LogBean log) {
        mapper.add(log);
    }

    @Override
    public PageInfo<LogBean> findByItem(int pageNO, LocalDate startDate, LocalDate endDate) {
        PageHelper.startPage(pageNO,PAGESIZE);
        PageInfo<LogBean> pageInfo =  PageInfo.of(mapper.findByItem(startDate, endDate));
        return pageInfo;
    }
}
